package org.example.config;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
@Slf4j
public class RabbitMqListener {



    @RabbitListener(queues = "sms_inter")
    public void listen(String submit, Message message, Channel channel) throws IOException {
        log.info("【策略模块-接收消息】 接收到接口模块发送的消息 submit = {}",submit);
        // 处理业务…………
      //  int mmm=10/0;
        log.info("【策略模块-消费完毕】手动ack");
        channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
    }
}
